//
//  THCPCBaseVC.m
//  YJB
//
//  Created by 中电大维 on 2016/12/31.
//  Copyright © 2016年 YJB. All rights reserved.
//

#import "THCPCBaseVC.h"

@interface THCPCBaseVC ()

@end

@implementation THCPCBaseVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.tableView.backgroundColor = kUIColorFromRGB(0xeeeeee);
    self.tableView.rowHeight = 50;
    self.tableView.tableFooterView = [UIView new];
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    [self.tableView registerClass:[THCpcHallCell class] forCellReuseIdentifier:cpcHallCellID];
    self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(loadData)];
    [self.tableView.mj_header beginRefreshing];
}

- (void)loadData
{
    
}
#pragma mark - tableviewDelegate ,tableviewDataSource

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return self.tasks.count;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    THCpcHallCell *cell = [tableView dequeueReusableCellWithIdentifier:cpcHallCellID forIndexPath:indexPath];
    cell.model = _tasks[indexPath.section];
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    if (0 == section) {
        return 10;
    }
    return 5;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 140;
}
- (NSMutableArray *)tasks
{
    if (!_tasks) {
        _tasks = [NSMutableArray array];
    }
    return _tasks;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
